home *** CD-ROM | disk | FTP | other *** search
- var $ = function(x) { return document.getElementById(x); };
- var gLat;
- var gLng;
-
- function embedInit(){
- var params = window.arguments[0];
- gLat = params.lat;
- gLng = params.lng;
- var title = params.title;
- $('embed-title').setAttribute('value',title);
- title = encodeURIComponent(title);
- var source = "http://maps.stcstm.org/embed?lat="+gLat+"&lng="+gLng+"&title="+title+"&type=m&zoom=11";
- var iframecode = '<iframe src="'+source+'" width="400" height="300" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" />';
- $('minimap-embed-code').setAttribute('value',iframecode);
- var body = $('minimap-embed-iframe').contentWindow.document.getElementsByTagName('body')[0];
- body.innerHTML = '<div width="100%" height="100%" align="center">'+iframecode+'</div>';
- }
-
- function embedRefresh(){
- var mt = $('minimap-embed-maptype').value;
- var z = $('minimap-embed-zoom').value;
- var title = $('embed-title').value;
- title = encodeURIComponent(title);
- var w = $('minimap-embed-width').value;
- var h = $('minimap-embed-height').value;
- var source = "http://maps.stcstm.org/embed?lat="+gLat+"&lng="+gLng+"&title="+title+"&type="+mt+"&zoom="+z;
- var iframecode = '<iframe src="'+source+'" width="'+w+'" height="'+h+'" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" />';
- $('minimap-embed-code').setAttribute('value',iframecode);
- var body = $('minimap-embed-iframe').contentWindow.document.getElementsByTagName('body')[0];
- body.innerHTML = '<div width="100%" height="100%" align="center">'+iframecode+'</div>';
- }
-
-
-
-